get basename without extension python

39

from pathlib import Path

Path('/root/dir/sub/file.ext').stem
# returns file

Comments

Submit
0 Comments